# 热更新
target=$1

config_file=config/config.${target}
if [ -z ${target} ]; then
    config_file=config/config
fi

if [ ! -f ${config_file} ]; then
    echo "config file ${config_file} not exist"
    exit 1
fi

ip=`sed -n -r 's/debug_ip *= *"([0-9\.]*)"/\1/p' $config_file`
port=`sed -n -r 's/debug_port *= *([0-9]+)/\1/p' $config_file`
if [ -z ${ip} ] || [ -z ${port} ]; then
    echo "debug_ip or debug_port not found in config file: $config_file"
    exit 1
fi

curl --http0.9 --noproxy "*" "http://${ip}:${port}/call/.HOT_MGR/\"hotfix\""